package com.ad.pet.ui;

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

import com.ad.pet.R;
import com.ad.pet.utils.LyxUtils;

/**
 * Created by SEELE on 2019/6/3.
 */

public class CompleteBackCashDialog extends Dialog {

    private View mView;


    public CompleteBackCashDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
        initView(context);
    }

    private void initView(Context context) {

        mView = View.inflate(context, R.layout.layout_complete_back_cash,null);

        ImageView imageView =mView.findViewById(R.id.iv_close);
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });

        setContentView(mView);



        Window window = this.getWindow();
        WindowManager.LayoutParams lp = window.getAttributes();
        lp.width = LyxUtils.dp2px(getContext(),250); // 设置宽度
        lp.height = LyxUtils.dp2px(getContext(),300);
        this.getWindow().setAttributes(lp);
        window.setGravity(Gravity.CENTER);
    }



}
